//1.引入http模块

var http = require('http')
var url = require('url')

//2.用http模块创建服务

http.createServer(function (req,res) {
    //发送http头部
    //http状态值--200/ok
    //设置文件类型和字符集

    res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"})
    res.write("你好 node")
    //获取url的参数
    if (req.url != '/favicon.ico') {

        var params = url.parse(req.url,true)
        var aid = params.query.aid
        res.write(aid)
        console.log('2222',aid)
    }
    res.end()//结束响应



}).listen(8008)